/**
 * Created by suweiming on 2017/12/30.
 */
import {jsonToQueryStr} from './util';
function _fetch(url, obj = {}) {
    fetch('http://localhost/api/admin/' + url, obj)
        .then(function (res) {
            return res.text();
        })
        .then(function (body) {
            console.log(body);
        });
};
var get = (url) => _fetch(url); // get request
var post = (url, query) => _fetch(url, {method: 'POST', body: jsonToQueryStr(query)}); //post request
export {get, post};
export * from './util';
